package com.t.bricks.bussiness.db.dao.flowwork;

import com.t.bricks.bussiness.db.dao.common.BaseDao;
import com.t.bricks.bussiness.db.entity.flowwork.FlowWorkNode;
import com.t.bricks.model.MsgEmity;

public interface FlowWorkNodeDao<T> extends BaseDao<T> {
	
	/**
	 * 修改节点
	 * 注意:更新成功后对象属性iVersion值将被+1
	 * @Param flowWorkNode
	 * @return MsgEmity
	 */
	MsgEmity editNode(FlowWorkNode flowWorkNode);

	/**
	 * 审批节点
	 * @param flowWorkNode 当前节点
	 * @return
	 */
	MsgEmity auditing(FlowWorkNode flowWorkNode);
	
	/**
	 * 查找发起者节点
	 * @param sWorkId
	 * @return
	 */
	MsgEmity findByType2(String sWorkId);
	
	/**
	 * 查找所有审核完毕待执行任务的节点
	 * @return
	 */
	MsgEmity findByType3();
	
	/**
	 * 查找所有审核完毕待执行任务的节点数量
	 * @return
	 */
	int findCountByType3();

	/**
	 * 结束节点
	 * @param flowWorkNode
	 * @return
	 */
	MsgEmity overNode(FlowWorkNode flowWorkNode);
	
	/**
	 * 更新任务执行信息
	 * @param flowWorkNode
	 * @return
	 */
	int editApiResult(FlowWorkNode flowWorkNode);
	
}
